from docx import Document
from docx.shared import Inches
 
document = Document()
 
document.add_heading('Document Title', 0)
 
p = document.add_paragraph('A plain paragraph having some ')
p.add_run('bold').bold = True
p.add_run(' and some ')
p.add_run('italic.').italic = True
 
document.add_heading('Heading, level 1', level=1)
document.add_paragraph('Intense quote', style='IntenseQuote')
 
document.add_paragraph(
    'first item in unordered list', style='ListBullet'
)
document.add_paragraph(
    'first item in ordered list', style='ListNumber'
)
 
document.add_picture('https://mmbiz.qpic.cn/mmbiz_jpg/n1YibWialeybgjNxHsnBlf08bsSibYTiaaNNlxZ9BpUKfY4mic1cFqTqE3zvBTpbfQPbLYCc7r2Ee2jc33EFOYg4z4A/0?wx_fmt=jpeg', width=Inches(5))
 
 
document.add_page_break()
 
document.save('demo.docx')